<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<!-- saved from url=(0110)file:///E:/wamp/www/sh/Application/Home/View/Index/%E5%95%86%E6%88%B7%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F.html -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>商户管理系统</title>
<meta name="Keywords" content="">
<meta name="Description" content="">

<meta http-equiv="Cache-Control" content="no-cache">
<meta name="MobileOptimized" content="240">

<meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">        
<!-- Mobile Devices Support @begin -->
  
  <meta content="no-cache,must-revalidate" http-equiv="Cache-Control">
  <meta content="no-cache" http-equiv="pragma">
  <meta content="0" http-equiv="expires">
  <meta content="telephone=no, address=no" name="format-detection">
  <meta name="apple-mobile-web-app-capable" content="yes"> <!-- apple devices fullscreen -->
  <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<!-- Mobile Devices Support @end -->
<link rel="stylesheet" type="text/css" href="/agent_admin/Public/home/css/public.css" media="all">
<link rel="stylesheet" type="text/css" href="/agent_admin/Public/home/css/style.css" media="all">
<script src="/agent_admin/Public/home/js/jquery-2.1.0.min.js.下载"></script>
<script src="/agent_admin/Public/home/js/My97DatePicker/WdatePicker.js"></script>
</head>

<body class="body mui-android mui-android-6 mui-android-6-0">
<div class="page_top_box">
    <center>
        <div class="page_top">
            <a href="index.html" class="back"><img src="/agent_admin/Public/home/images/ico_back.png"></a>
            <a id="seabtn" href="javascript:void(0)" class="sear"><!-- <img src="/agent_admin/Public/home/images/ico_search.png"> --></a>
            <div class="pg_name" onclick="location.reload()">我的返利</div>
			<!-- <a href="<?php echo U('Index/reward.html') ?>" class="add"><img src="/agent_admin/Public/home/images/shua.gif"></a> -->
        </div>
    </center>
    </div>
		<div class="sousuo" style="margin: 5px 6%">
			<form id="myform" name="form1" method="post" action="">  
				<dl class="sou" style="width:38%;height:50px;margin-top:2%;float:left;">
					充值ID<input style="width:43%;height:40%;border-radius:7px;" type="" name="accounts" placeholder="">
				</dl>
				<dl class="sou" style="width:47%;height:50px;margin-top:2%;float:left;">
					<b style="width:10%;">状态</b>
					<select id="type" name="type" style="margin-top:1%;clear:both;width:44%;">
						<option value="1" >领取</option>
						<option value="0">未领取</option>
						<option value="" selected="selected">默认</option>
					</select>
				</dl>
				<input style="float:right;width:15%;height:25px;margin-top:2%;border-radius:9px;background:#FFF;color:#000;line-height:2px;" type="submit" name="soso" value="搜索" class="btn">
				<div class="datetme" style="float:left;width:100%;">
					时间搜索
					<input type="text" class="Wdate" name="sdate" onFocus="WdatePicker({lang:'zh-cn',dateFmt:'yyyy-MM-dd HH:mm:ss ',readOnly:true})" style="width:20%;height:18px;margin-top:6px;font-size:1px;"/>
						--
					<input type="text" class="Wdate" name="edate" onFocus="WdatePicker({lang:'zh-cn',dateFmt:'yyyy-MM-dd HH:mm:ss ',readOnly:true})" style="width:20%;height:18px;margin-top:6px;font-size:1px;"/>
				</div>	
			</form>	
			<span style="float:right;margin-top:-20px;font-size:1.2em;height:20px;">
				<a style="color:red;width:5%;font-size:0.8em;margin-right:5px;border: solid 2px red;padding: 3px;border-radius: 5px" href="<?php echo '/agent_admin/subordinate' ?>">下级返利</a>
			</span>
		</div>


    <div class="user_list">
	
		<dt style="width:16%">充值代理ID</dt>
    	<dt class="ccd" style="width:16%">充值数量</dt>
		<dt style="width:16%">返利数量</dt>
		<dt style="width:16%">时间</dt>
		<dt style="width:16%">状态</dt>
		<dt style="width:16%">点击领取</dt>

    </div>
	<?php  foreach ($rebate as $v){ ?>
	 <form id="myform" name="form1" method="get" action="<?php echo U('Index/settle') ?>">  
		<div class="user_list">
			<dt style="width:16%"><?php echo $v['recipient'] ?></dt>
	    	<dt style="width:16%"><?php echo $v['gems'] ?></dt>
			<dt style="width:16%"><?php echo $v['accumulative'] ?></dt>
			<dt style="width:19%;line-height:20px;font-size:1px"><?php echo $v['times'] ?></dt>
			<dt style="width:13%;font-size:1em">
			<?php if($v['state']==1){echo '已领取';} if($v['state']==0){echo '未领取';} ?>
			</dt>
			<?php  if($_SESSION['agencylv']< 10){ if ($v['state']==0){ echo '<a style="font-size:1em;line-height:50px;margin-left:2%;" href="/agent_admin/settle?id=',$v['id'].'">
				 <span style="margin-left:2%;">点击领取</span></a>'; } if ($v['state']==1){ echo '<span style="margin-left:4%;line-height:50px;">已经领取</span>'; } }?>
	    </div>
	  </form>
    <?php }?>
	
		
    <dl id="ulist" class="user_list">
        </dl>
    <div id="" smore="" class="list_more" onclick="showMore()">加载更多</div>
    <input id="cpage" name="cpage" type="hidden" value="1">
    	<!-- <a href="#" onclick="goTop();return false;"><img style="width:60px;float:right" src="/agent_admin/Public/home/images/top.jpg"></a> -->

    <div class="pg_foot_box">
	<center>
	    <div class="pg_foot">
	        <a href="<?php echo '/agent_admin/index.html' ?>">商户管理平台</a>
	    </div>
	</center>
</div>    
	<!-- <?php// if($_POST['type']==0){echo '<a style="font-size:1em;line-height:50px;margin-left:2%;" href=" '.U('Index/settle_2',array('id'=>$v['id'])).' " ><span style="margin-left:2%;">全部领取</span></a>';} ?> -->
  
    
    <script src="/agent_admin/Public/home/js/mui.min.js.下载"></script>
	<script src="/agent_admin/Public/home/js/mui.picker.min.js.下载"></script>  
    <script type="text/javascript">
	
function goTop(acceleration, time)
{ 
	acceleration = acceleration || 0.1; 
	time = time || 16; 
	 
	var x1 = 0; 
	var y1 = 0; 
	var x2 = 0; 
	var y2 = 0; 
	var x3 = 0; 
	var y3 = 0; 
	 
	if (document.documentElement) 
	{ 
		x1 = document.documentElement.scrollLeft || 0; 
		y1 = document.documentElement.scrollTop || 0; 
	} 
	if (document.body) 
	{ 
		x2 = document.body.scrollLeft || 0; 
		y2 = document.body.scrollTop || 0; 
	} 
	var x3 = window.scrollX || 0; 
	var y3 = window.scrollY || 0; 
	 
	// 滚动条到页面顶部的水平距离 
	var x = Math.max(x1, Math.max(x2, x3)); 
	// 滚动条到页面顶部的垂直距离 
	var y = Math.max(y1, Math.max(y2, y3)); 
	 
	// 滚动距离 = 目前距离 / 速度, 因为距离原来越小, 速度是大于 1 的数, 所以滚动距离会越来越小 
	var speed = 1 + acceleration; 
	window.scrollTo(Math.floor(x / speed), Math.floor(y / speed)); 
	 
	// 如果距离不为零, 继续调用迭代本函数 
	if(x > 0 || y > 0) { 
	var invokeFunction = "goTop(" + acceleration + ", " + time + ")"; 
	window.setTimeout(invokeFunction, time); 
	} 
} 
	
		$("#seabtn").click(function(){
			$("#seabox").slideToggle();
		});
		
		function goSearch(){
			if($("#sdate").val() == "" && $("#edate").val() == ""){
				hintPop("请输入开始和结束日期！"); return false;
			}
			
			window.location.href="?sdate=" + $("#sdate").val() + "&edate=" + $("#edate").val();
		}
		
		function showMore(){
			var total = Number("0");
			var cpage = Number($("#cpage").val());
			if(cpage >= total){
				hintPop("没有更多返利记录了"); return false;
			}else{
				$.ajax({
					type: "get",
					url: "prog.php?ac=ajax.class&do=reward",
					data: {"pset": "15","cpage": cpage, "sdate":"0", "edate":"1482825634"},
					success: function (result) {
						$("#ulist").append(result);
						$("#cpage").val(cpage + 1);
						
					}
				});
			}
		}
		
		function hintPop(msg){
			$("#hintmsg").html(msg);
			$("#hintbox").css({"opacity": "1", "display": "block"});
			$("#hintbox").animate({"bottom":"80px"}, "last", function(){
				setTimeout(function(){
					$("#hintbox").animate({"opacity": "0"}, "last", function(){
						$("#hintbox").css({"bottom":"0px", "display": "none"});
					});
				}, 2000);
			});
		}
		
		(function($) {
			$.init();
			var result = $('#result')[0];
			var btns = $('.picker');
			btns.each(function(i, btn) {
				btn.addEventListener('tap', function() {
					var optionsJson = this.getAttribute('data-options') || '{}';
					var options = JSON.parse(optionsJson);
					var id = this.getAttribute('id');
		
					var picker = new $.DtPicker(options);
					picker.show(function(rs) {
						
						document.getElementById(id).value = rs.text;
												
						picker.dispose();
					});
				}, false);
			});
		})(mui);
	</script>

</body>
</html>